//
//  YLReservationRecordCell.m
//  YLFinanceService
//
//  Created by she1323 on 2018/1/17.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "YLReservationRecordCell.h"
#import "YLReservationRecordModel.h"
@interface YLReservationRecordCell()
@property (weak, nonatomic) IBOutlet UIButton *cancelButton;
@property (weak, nonatomic) IBOutlet UIImageView *icon;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@end


@implementation YLReservationRecordCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (IBAction)cancel:(UIButton *)sender {
    if (self.cancelBlock) {
    
        self.cancelBlock(_item.productId, _section);
    }
}

- (void)setItem:(YLReservationRecordItem *)item
{
    _item = item;
    _cancelButton.hidden = !item.showCancel;
    _icon.image = [UIImage imageNamed:item.iconName];
    _titleLabel.text = item.showTitle;
    
}



+ (NSString *)cellID
{
    return @"YLReservationRecordCell";
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
